-model_name = controller_name.singularize
-model_title = model_name.titleize
-content_for :modal_title do
  -if f.object.new_record?
    Create a new #{model_title}
  -else
    Edit #{model_title}

-if !f.object.new_record?
  -content_for :modal_delete_path, method("delete_flow_#{model_name}_path").call(f.object)

.row-fluid
  =wrapped_text_field f, :span6, :title, :placeholder => 'Enter title', :label_name => 'Title <span class="required">*</span>'.html_safe
  .span6
    .row-fluid
      =wrapped_text_field f, :span12, :slug, :label_name => 'Code (autofill)', :placeholder => "#{f.object.default_slug_prefix.upcase}-XXXX"
      -#=wrapped_text_field f, :span6, :version, :placeholder => '1.1.1'
.row-fluid
  =wrapped_text_area f, :span6, :description, :class => 'double wysihtml5', :wrapper_div_class => 'wysiwyg-area', :placeholder => 'Enter description here'
  .span6
    .row-fluid
      =wrapped_date_field f, :span6, :start_date, :class => 'date', :label_name => 'Effective Date', :placeholder => 'MM/DD/YYYY'
      =wrapped_date_field f, :span6, :stop_date, :class => 'date', :label_name => 'Stop Date', :placeholder => 'MM/DD/YYYY'
    .row-fluid
      -if params[:force_type_string].present? || !f.object.can_change_type_string?
        .span6
          %label Type
          =f.hidden_field :type_string
          =hidden_field_tag :force_type_string, params[:force_type_string]
          .item.oneline=f.object.type_string
      -else
        =wrapped_select f, :span6, :type_string, RiskyAttribute.type_strings.map{ |t| [t.titleize, t] }, :selected => (f.object.type_string), :label_name => 'Type'

.row-fluid
  =wrapped_text_field f, :span6, :url, :label_name => 'Direct URL (optional)', :placeholder => 'http://www.example.com/'

=render :partial => "shared/wysihtml5"
